<?PHP
include '../m/ajax_constants.php';
$conf->debug=false;
if(!empty($_GET))
	$name = $_GET['user_name'];
else	
	$name = $_POST['user_name'];
	
	
	
	$w[0]='user_name';
	$w[1]=$name;
	$w[2]='=';
	$where[]=$w;
	$data=get_sql('user','user_id',$where,NULL);

if(empty($data))
{
	$retval['text'] = "<img src=assets/images/check.png height=20 width=20 style='vertical-align:middle' > valid username";
	$retval['valid'] = 1;
}
else
{
	$retval['text'] = "<img src=assets/images/eks.png height=20 width=20 style='vertical-align:middle' > username already in use";
	$retval['valid'] = 0;
}
echo json_encode($retval);
?>